<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>Swfupload 测试</title>
	<script type="text/javascript" src="js/swfupload.js"></script>
</head>
<body>
	<div id="file_list">
		<ul>
			<li>
				<span>文件名</span>
				<span>进度</span>
				<span>操作</span>
			</li>
		</ul>
	</div>
	<form id="form1" action="index.php" method="post" enctype="multipart/form-data">
		<span id="spanSWFUploadButton"></span>
		<input type="button" value="start upload" onclick="startUpload();return false;" />
	</form>
	<script type="text/javascript">
		var swfu;	
		window.onload = function () {
			swfu = new SWFUpload({
				upload_url : "upload.php",
				flash_url : "flash/swfupload.swf",
				file_size_limit : "20 MB",
				
				button_placeholder_id : "spanSWFUploadButton",	
				button_text: '<span class="theFont">Select file</span>',
				button_width: "65",
				button_height: "29",
				button_cursor: SWFUpload.CURSOR.HAND,
				
				
				//file_queued_handler : fileQueued,
				//file_queue_error_handler : fileQueueError,
				//file_dialog_complete_handler : fileDialogCompleteHandler,
				upload_start_handler : uploadStartHandler,
				//upload_progress_handler : uploadProgress,
				//upload_error_handler : uploadError,
				//upload_success_handler : uploadSuccess,
				//upload_complete_handler : uploadComplete,
				//queue_complete_handler : queueComplete,
				upload_success_handler : uploadSuccessHandler,
				upload_complete_handler : uploadCompleteHandler
			});
		};
		
		function uploadStartHandler(file){
			return true;
		}
		
		function uploadSuccessHandler(file,data){
			alert(data);
			//alert(file['index']);
		}

		function uploadCompleteHandler(file){
			this.startUpload();
			//document.getElementById('file_list').
		}
		
		function fileDialogComplete(numFilesSelected, numFilesQueued){
			//alert(numFilesSelected);
			//this.startUpload();
		}
		
		function startUpload(){
			alert('aa');
			swfu.startUpload();
		}
	</script>
</body>
</html>
